package social.hub.google.orkut;

import static org.junit.Assert.assertEquals;

import java.util.List;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import social.hub.google.orkut.OrkutClient;
import social.hub.google.orkut.OrkutClientImpl;
import social.hub.google.orkut.OrkutProfile;

public class ITOrkutClientImpl {

	private OrkutClient	client;

	@Before
	public void setUp() throws Exception {

		final String apiKey = "www.amigon.com.br";
		final String apiSecret = "43iELZZbcbn/m3lWpUQIZljA";
		final String accessToken = "1/KXdB5fVx2RkNRLnW84jbKNH1CO6T_UWvwCYLqqRAEfI";
		final String accessTokenSecret = "Z_dASZVE_CwEIP3KQBdXgOX9";

		client = new OrkutClientImpl(apiKey, apiSecret, accessToken, accessTokenSecret);

	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetFriends() {

		int esperado = 19;

		final List<OrkutProfile> friends = client.getFriends();

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetFriendsString() {

		String profileId = "13853019280966489025";
		int esperado = 19;

		final List<OrkutProfile> friends = client.getFriends(profileId);

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetUserProfile() {

		String esperado = "09119659556400083846";

		final OrkutProfile user = client.getUserProfile();

		assertEquals(esperado, user.getId());

	}

	@Test
	public void testGetUserProfileLong() {

		String profileId = "09119659556400083846";

		final OrkutProfile user = client.getUserProfile(profileId);

		assertEquals(profileId, user.getId());

	}

	@Test
	public void testUpdateStatus() {
		client.updateStatus("Teste Integração Orkut");
	}

}
